<?php namespace Common\Model;
use Hdphp\Model\Model;
//地址模型类
class Address extends Model{
	protected $table='address';
//	自动验证
	protected $validata=array(
	array('address','required','收货地址不能为空',3,3),
	array('tel','required','手机号码不能为空',3,3),
	array('code','required','邮编不能为空',3,3),
	
	);
	
	
//	地址添加
public function store(){
	
	if(!$this->create()) return false;
	
//				sp($_POST);die;
				$postdata=$_POST;
		//		重组数组
		$data['name']=$postdata['name'];
		$data['address']=$postdata['sheng'].$postdata['shi'].$postdata['qu'].$postdata['address'];
		$data['code']=$postdata['code'];
		$data['tel']=$postdata['tel'];
		$data['huser_huid']=$_SESSION['uid'];
		//sp($data);die;
		
	return $this->add($data);
}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}
